package com.sun.officeoa.service;

import com.sun.officeoa.bean.Department;
import com.sun.officeoa.dao.DepartmentDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DepartmentService {

    @Resource
    private DepartmentDao departmentDao;

    public int updateDepById(String name, int id) {
        return departmentDao.updateDepById(name,id);
    }

    public int insert(String name) {
        return departmentDao.insert(name);
    }

    public int deleteDepById(int id) {
        return departmentDao.deleteDepById(id);
    }

    public List<Department> getAllDepartment() {
        return departmentDao.getAllDepartment();
    }


}
